﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AjaxControlToolkit;

namespace SisEagle.View.Web.UserControl
{
    public partial class UcPrivilegios : System.Web.UI.UserControl
    {
        #region Singleton
        private SisEagleBO.PrivilegiosBO _PrivilegiosBusiness;
        private SisEagleBO.PrivilegiosBO PrivilegiosBusiness
        {
            get
            {
                if (_PrivilegiosBusiness == null)
                    _PrivilegiosBusiness = new SisEagleBO.PrivilegiosBO();

                return _PrivilegiosBusiness;
            }
        }

        #endregion

        #region Controls
        private ComboBox _cmbPrivilegios;
        #endregion


        #region Page-Load/OnInit
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            inicializeComponentes();
            carregaCombo();


        }

        private void carregaCombo()
        {

            ComboPrivilegios.DataSource = PrivilegiosBusiness.FindAll(ComboPrivilegios.DataTextField);
            ComboPrivilegios.Items.Add("...");
            ComboPrivilegios.DataBind();

        }
        protected void Page_Load(object sender, EventArgs e)
        {


        }
        #endregion

        #region Binding


        public ComboBox ComboPrivilegios
        {
            get
            {


                return _cmbPrivilegios;
            }
            set
            {

                _cmbPrivilegios = value;
            }
        }


        #endregion

        #region finds
        private void inicializeComponentes()
        {
            _cmbPrivilegios = FindControl("cmbPrivilegios") as ComboBox;
        }
        #endregion
    }
}